//
//  GeneratorViewController.m
//  二维码识别
//
//  Created by 王虎彬 on 16/6/11.
//  Copyright © 2016年 王虎彬. All rights reserved.
//

#import "GeneratorViewController.h"
#import <CoreImage/CoreImage.h>
#import "QRCodeManager.h"


@interface GeneratorViewController()

@property (weak, nonatomic) IBOutlet UITextField *textField;

@property (weak, nonatomic) IBOutlet UIImageView *imageView;

@end



#pragma mark - 生成二维码
@implementation GeneratorViewController
- (IBAction)createBtn:(id)sender {
    
    //1.获取输入框中的内容
    NSString *inputMsg = self.textField.text;
    
    if (inputMsg.length == 0) {
        
        NSLog(@"请输入的内容");
        return;
        
    }
    
    
    //2.生成二维码
    
    //生成二维码
    UIImage *foreImage = [UIImage imageNamed:@"erha"];
    
    self.imageView.image = [[QRCodeManager shareInstance]generateHDImageWithMsg:inputMsg fgImage:foreImage];
    
    //test
}


@end
